<!DOCTYPE html>
<html lang="zh-cn">
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta name="description" content="">
		<meta name="author" content="">
		<title>智慧公社 让问题变论题、深度发掘智慧之石</title>
		<link href="__PUBLIC__/css/bootstrap.min.css" rel="stylesheet">
		<link href="__PUBLIC__/css/font-awesome.min.css" rel="stylesheet">
		<link href="__PUBLIC__/css/animate.css" rel="stylesheet" />
		<link href="__PUBLIC__/css/index.css" rel="stylesheet" />
		<link href="__PUBLIC__/css/iosOverlay.css"  rel="stylesheet" type="text/css">
		<script src="__PUBLIC__/js/jquery.js"></script>
		<script src="__PUBLIC__/js/headroom.js"></script>
		<script src="__PUBLIC__/js/jquery.snippet.min.js"></script>
		<script src="__PUBLIC__/js/bootstrap.min.js"></script>
		<script src="__PUBLIC__/js/jquery.pin.min.js"></script>
		<script src="__PUBLIC__/js/index.js"></script>
		<script src="__PUBLIC__/js/jquery.hotkeys.js"></script>
		<script src="__PUBLIC__/js/bootstrap-wysiwyg.js"></script>
		<script src="__PUBLIC__/js/sco.countdown.js"></script>
		<script src="__PUBLIC__/js/discuss.js"></script>
		<script src="__PUBLIC__/js/iosOverlay.js"></script>
		<script src="__PUBLIC__/js/spin.min.js"></script>
		<script>
			var rewordUrl="{:U('Index/discussReword')}";
			var lookUrl="{:U('Index/discussLook')}";
			var articleTime;
			var mypageUser="{:U('Index/hispage')}";
			var urlOrder="{:U('Index/discussOrder')}";
			var urlJoin="{:U('Index/requestJoin')}";
			var urlImages="/sc2.0/Public/images/";
		</script>
		<!--<style>
		*{border: 1px solid rgb(250,0,255);}
		</style>-->
	</head>
     <body>

<!-- 头部导航开始 --> 

<!-- 头部导航开始 --> 
<include file="Index/title" /> 
<!-- 主体信息开始 -->

<div id='contents' class="container">
			<div class="hall-toptext">每晚来智慧公社阅读、思考、参与讨论，你会发现人生正在发生改变</div>
			<div class="hall-toptext" style="font-size:14px">Come to Stuccess everyday for discussing. Your life will change gradually</div>
			<p>&nbsp;</p>
			<div class="panel panel-default discuss-cont">
		<div class="panel-body">
					<div class="card-head">
				<div class="card-head-left"><img src="{$arrDis['img']}" width="45" class="img-circle"/></div>
				<div class="card-head-center">{$arrDis['name']} <span style="color:#999">发起</span><span style="color: #4bacc6">讨论</span><small>@{$arrDis['utime']|date='Y-m-d H:i:s',###}</small></div>
				<div class="card-head-right"><small><span class="fa fa-eye fa-lg" style="color:#99A9C8" title="浏览量"> {$arrDis['num']} </span>&nbsp;&nbsp;&nbsp;&nbsp;</small>
							<if condition="$order eq 1">
						<div class="btn btn-warning" style="color:#FFF;">√ 已订阅</div>
						<else/>
						<div class="disorder btn btn-warning" style="color:#FFF;" title="讨论结束后第一时间提醒您查看全部观点"> 订阅 {$arrDis['order']}</div>
						<!--{$arrDis['order']}--> 
					</if>
						</div>
				<div class="clearfix"></div>
			</div>
					<div class="card-body">
				<div class="title discuss">{$arrDis['title']}</div>
				<span id="contents1" value="{$arrDis['articleId']}" times="{$arrDis['utime']}"> </span>
				<div class="contents2"> {$arrDis['content']} </div>
			</div>
				</div>
	</div>
		<div class="discuss-user">
		<div class="discuss-user-left">参与者</div>
		<div class="discuss-user-center">
		<span>
			<volist name="info" id="vo"> <a href="{:U('Index/hispage',array('hispage'=>$vo['Uid']))}"> <img src="{$vo['img']}" width="30" title="{$vo['name']}"  /></a> </volist>
		</span>
		<span id="appImg" value="@{$appImg}">
		</span>
			<if condition = "$writer eq true">
				<span class="fa fa-plus fa fa-large" data-toggle="modal" data-target="#tlyaoqing" id="invite_img" style="cursor:pointer"></span>
			</if>
		</div>
		<div class="discuss-user-right">
			<if condition="$aTime eq 0">
				<if condition="$discuss neq 1">
					<button type="button" class="btn btn-primary join">我有观点</button>
				</if>
			</if>
			</div>
			<div class="discuss-user-right remainingInfo"></div>
		</div>
	<div class="discuss-time">
		<div class="discuss-time-left">正在讨论…</div>
		<div class="discuss-time-right"> 剩余时间：<span id="countdowner"></span> </div>
	</div>
			<div class="discuss-list">
		<foreach name="operate" item="op">
					<div class="discuss">
				<div class="disc-user"> <a href="{:U('Index/hispage',array('hispage'=>$op['uid']))}" title="{$op['uname']}"><img src="{$op['uimg']}" width="45" class="img-circle" /></a><br />
						</div>
				<div class="disc-body">
							<div class="disc-uname"> {$op['uname']} <span style="font-size:10px; color:#ccc;" class="discussTime" value="{$op['Ftime']}">{$op['oPtime']}</span> </div>
							<div class="disc-cont"> {$op['oPcontent']} </div>
						</div>
				<div class="clearfix"></div>
			</div>
				</foreach>
	</div>
			<div style="margin-bottom:60px;">
		<if condition="$discuss eq 1">
					<div id="mb">
				<div class="panel panel-default form-control-focus">
							<div class="btn-toolbar exitor-bar" data-role="editor-toolbar" data-target="#editor">
						<div class="btn-group"> <a class="btn" data-edit="bold" title="加粗 (Ctrl/Cmd+B)"><i class="fa fa-bold"></i></a> <a class="btn" data-edit="underline" title="下划线 (Ctrl/Cmd+U)"><i class="fa fa-underline"></i></a> <a class="btn" data-edit="strikethrough" title="删除线"><i class="fa fa-strikethrough"></i></a> </div>
						<div class="btn-group"> <span class="exitor-bar-span">|</span> </div>
						<div class="btn-group"> <a class="btn" data-edit="insertunorderedlist" title="无序列表"><i class="fa fa-list-ul"></i></a> <a class="btn" data-edit="insertorderedlist" title="有序列表"><i class="fa fa-list-ol"></i></a> </div>
						<div class="btn-group"> <span class="exitor-bar-span">|</span> </div>
						<div class="btn-group"> <a class="btn dropdown-toggle" data-toggle="dropdown" title="添加超链接"><i class="fa fa-link"></i></a>
									<div class="dropdown-menu">
								<div class=" input-group">
											<input type="text" class="form-control" placeholder="URL" data-edit="createLink" onclick="if(this.value == '')this.value='http://';"/>
											<span class="input-group-btn">
									<button class="btn" type="button">加入</button>
									</span> </div>
							</div>
									<a class="btn" data-edit="unlink" title="删除超链接"><i class="fa fa-cut"></i></a> </div>
						<div class="btn-group"> <span class="exitor-bar-span">|</span> </div>
						<div class="btn-group"> <a class="btn" data-edit="undo" title="撤销 (Ctrl/Cmd+Z)"><i class="fa fa-undo"></i></a> <a class="btn" data-edit="redo" title="重做 (Ctrl/Cmd+Y)"><i class="fa fa-repeat"></i></a> </div>
						<div class="btn-group"> <a class="btn" title="Insert picture (or just drag & drop)" id="pictureBtn"><i class="fa fa-picture"></i></a>
									<input type="file" data-role="magic-overlay" data-target="#pictureBtn" data-edit="insertImage" />
								</div>
					</div>
							<div class="panel-body" style="padding-top:5px;">
						<div data-droppable="" idt="true" style="display: block;color: rgb(153, 153, 153);" id="editor">看了他们说的，你肯定也有自己的见解，对吗？大胆说出来~</div>
					</div>
						</div>
				<!-- 发送通知给：王瑞<br/>-->
				<button type="button" class="btn btn-success confirm-btn discussImmedia">发表观点</button>
				<!--<button type="button" class="btn"onclick="$('#woqu').slideUp();    $('#editor').empty();    $('.fake-textarea').fadeIn(); ">取消</button>--> 
				
			</div>
				</if>
		<!--
            <div class="fake-textarea" style="display: block;">
                点击发表评论
            </div>
            --> 
	</div>
		</div>
			<!-- 主体信息结束 -->
			<if condition = "$writer eq true">
			<div class="modal fade" id="tlyaoqing" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
				<div class="modal-dialog">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
							<h3 class="modal-title" id="myModalLabel">邀请<span style="font-weight: lighter;">(最多12人哟)</span></h3>
						</div>						
						<div class="modal-body row">
							<if condition="count($recommend) gt 0">
								<span id="span-recommend">
									<h4 class="modal-title">推荐:</h4>
									<foreach name="recommend" item="ui">
										<div class="modal-invite recommend cursor col-md-4"><img src="{$ui['user_img']}" height="45" user_id="{$ui['user_id']}"  class="img-circle"/>{$ui['user_name']}</div>
									</foreach>
									<hr style="width:100%;float:left;margin:5px;">
								</span>
							</if>
							<span id="span-not-recommend">
							<h4 class="modal-title">我关注的:</h4>
							<foreach name="uimg" item="ui">
								<div class="modal-invite not-recommend cursor col-md-4"><img src="{$ui['user_img']}" height="45" user_id="{$ui['user_id']}"  class="img-circle"/>{$ui['user_name']}</div>
							</foreach>
							</span>
						</div>
						<div class="modal-footer">
							<button id="invite-sub" type="button" class="btn btn-primary">确认</button>
						</div>
							</div>
					<!-- /.modal-content --> 
				</div>
				<!-- /.modal-dialog --> 
			</div>
			</if>
			<script type="text/javascript">
				$(document).ready(function () {
					var remaining = 12;
					var removeActive = function(){
						var invite = $('#appImg').attr("value").substr(1);
						if(	invite )
							invite = invite.split("@");
						$("#tlyaoqing .modal-content .modal-body .img-circle").each(function(index, element) {
							if(invite.indexOf($(element).attr('user_id')) != -1)
							{
								$(element).addClass("active");
								$(element).parent().remove();
							}
							if($("#span-recommend .recommend").size() <= 0){
								$("#span-recommend").remove();
							}
						});
						remaining -= invite.length;
						if(remaining > 0)
							$(".remainingInfo").html("(限定12人，剩余" + remaining + "个空位)");
						else{
							$(".remainingInfo").html("来晚咯，此讨论已满员！");
							$('#invite_img').remove();
						}
					}
					removeActive();
					$("#invite-sub").click(function () {
						var userid = new Array;
						var userimg = new Array;
						var user="";
						var i = 0;
						fuck = ""
						var imgadd;
						$(".modal-invite > .active:visible").each(function () {
							userid[i] = $(this).attr("user_id");
							userimg[i] = $(this).attr("src");
							user +="@"+$(this).attr("user_id");
							i++;
						});
						$('#appImg').attr("value",user);
						for (x in userimg) {
							fuck = ' <a href="/sc2.0/Index/hispage/hispage/' + userid[x] + '.html"><img src="' + userimg[x] + '" width="30"/></a> ';
							$(fuck).appendTo('#appImg');
						}
						$('#tlyaoqing').modal('hide');
						var invite = $('#appImg').attr('value');
						removeActive();
						$.ajax({
							url:"{:U('Index/discussInvite')}",
							type:"POST",
							data:{
									articleId:$("#contents1").attr("value"),
									invite:invite
								},
							success: function(data){
								
								}							
						});
					});
					$("#tlyaoqing").on("click",".modal-invite",function (e) {
						if($(".modal-invite > .active").length < remaining)
							$(this).children("img").toggleClass("active");
						else
						{
							$(this).children("img").removeClass("active");
							
						}
					});
				});
			</script>
<footer> </footer>
<script>
    $("#editor").click(function () {
		if($(this).attr("idt") == "true")
		{
			$(this).css("color","#000");
			$(this).text("");
			$(this).attr("idt","false");
		}
		else if($(this).html() == "")
		{
			$(this).css("color","#999");
			$(this).text("看了他们说的，你肯定也有自己的见解，对吗？大胆说出来~");
			$(this).attr("idt","true");
		}
		/* $("#input-footer").slideDown("slow");
		$("#btn-toolbar").slideDown("slow");*/    	
	});
	$("#editor").blur(function(){
		if($(this).text() == "" && $(this).attr("idt") == "false")
		{
			$(this).css("color","#999");
			$(this).text("看了他们说的，你肯定也有自己的见解，对吗？大胆说出来~");
			$(this).attr("idt","true");
		}
	});
    </script> 
<script type="text/javascript">
        $(function () {
            var today = new Date()
                , tomorrow = Math.round(today.setDate(today.getDate() + 1) / 1000)	// seds instead of milliseconds
            var articleTime=$('#contents1').attr('times');
            $('#countdowner').scojs_countdown({ until: tomorrow - (tomorrow-articleTime-172800)});
			if((tomorrow - articleTime - 86400)>172800){ 
				$('#mb').hide();
				$('#invite_img').remove();
				$('.discuss-time-right').html('讨论为期2天，已经结束，下次可要抓紧~');
			 
			}else{

			}
        });

    </script> 
<script type="text/javascript">
        jQuery(function ($) {
            $(document).ready(function () {
                var header = new Headroom(document.querySelector(".navbar"), {
                    tolerance: 0,
                    offset: 0,
                    classes: {
                        initial: "animated",
                        pinned: "slideDown",
                        unpinned: "slideUp"
                    }
                });
                header.init();
                $('button[data-loading-text]').click(function () {
                    var btn = $(this).button('loading');
                    setTimeout(function () {
                        btn.button('reset');
                    }, 2000);
                });
                $('.card').mouseover(function () {
                    $(this).find('.close').toggleClass("hidden");
                });
                $('.card').mouseout(function () {
                    $(this).find('.close').toggleClass("hidden");
                });
                $('[data-dismiss="fuck"]').click(function () {
                    $(this).closest('.card').fadeOut(1000);
                });
              //  var messcont = $("#myTabContent").find(".mess-close").size();
               // $(".mess-nord").text(messcont);
                $('.fake-textarea').click(function () {
                    $('.fake-textarea').hide();
                    $('#woqu').fadeIn();
                    $("#editor").focus();
                });

            });
        });
    </script> 
<script>
        $(function () {
            function initToolbarBootstrapBindings() {

                $('a[title]').tooltip({ container: 'body', placement: 'bottom' });
                $('.dropdown-menu input').click(function () { return false; })
                    .change(function () { $(this).parent('.dropdown-menu').siblings('.dropdown-toggle').dropdown('toggle'); })
                .keydown('esc', function () { this.value = ''; $(this).change(); });

                $('[data-role=magic-overlay]').each(function () {
                    var overlay = $(this), target = $(overlay.data('target'));
                    overlay.css('opacity', 0).css('position', 'absolute').offset(target.offset()).width(target.outerWidth()).height(target.outerHeight());
                });
                if ("onwebkitspeechchange" in document.createElement("input")) {
                    var editorOffset = $('#editor').offset();
                    $('#voiceBtn').css('position', 'absolute').offset({ top: editorOffset.top, left: editorOffset.left + $('#editor').innerWidth() - 35 });
                } else {
                    $('#voiceBtn').hide();
                }
            };
            function showErrorAlert(reason, detail) {
                var msg = '';
                if (reason === 'unsupported-file-type') { msg = "Unsupported format " + detail; }
                else {
                    console.log("error uploading file", reason, detail);
                }
                $('<div class="alert"> <button type="button" class="close" data-dismiss="alert">&times;</button>' +
                 '<strong>File upload error</strong> ' + msg + ' </div>').prependTo('#alerts');
            };
            initToolbarBootstrapBindings();
            $('#editor').wysiwyg({ fileUploadError: showErrorAlert });
            window.prettyPrint && prettyPrint();
        });
    </script> 

<!-- JiaThis Button BEGIN --> 
<script type="text/javascript" >
var jiathis_config={
	siteNum:9,
	sm:"tsina,qzone,renren,cqq,weixin,yixin,fb,twitter,googleplus",
	summary:"",
	showClose:false,
	shortUrl:false,
	hideMore:true
}
</script> 
<script type="text/javascript" src="http://v3.jiathis.com/code_mini/jiathis_r.js?uid=1952592&btn=r3.gif&move=0" charset="utf-8"></script> 
<!-- JiaThis Button END --> 

<include file="Index/copyright" />
</body>
</html>